<?php

namespace pmvc\mvc\view;

use pmvc\mvc\ViewHandler;
use pmvc\mvc\Request;
use pmvc\mvc\Response;

class JSONViewHandler 
    implements ViewHandler {
    	
    function renderView(Request $request, Response $response, $viewName) {
    	$response->setHeader("Content-Type", "application/json");
    	$response->getStream()->write(
    		json_encode($response->getModel()));
    }
    
}

?>